package com.bush.mall.member.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.member.entity.MemberStatisticsInfoEntity;
import com.bush.mall.member.service.MemberStatisticsInfoService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 会员统计信息
 * @author RUN
 * @date 2022-11-29
 */
@RestController
@RequestMapping("memberstatisticsinfo")
@Api(tags = "会员统计信息管理" )
public class MemberStatisticsInfoController {

    @Resource(name= MemberStatisticsInfoService.BEAN_ID)
    private MemberStatisticsInfoService memberStatisticsInfoService;

    /**
     * 分页查询会员统计信息列表
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "分页查询会员统计信息列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return memberStatisticsInfoService.queryForPage(current,size);
    }

    /**
     * 保存会员统计信息表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "保存会员统计信息表单")
    @PostMapping
    public Result saveMemberStatisticsInfo(@RequestBody MemberStatisticsInfoEntity memberStatisticsInfo){
        return memberStatisticsInfoService.saveMemberStatisticsInfo(memberStatisticsInfo);
    }

    /**
     * 修改会员统计信息表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "修改会员统计信息表单")
    @PutMapping
    public Result updateMemberStatisticsInfo(@RequestBody MemberStatisticsInfoEntity memberStatisticsInfo){
        return memberStatisticsInfoService.updateMemberStatisticsInfo(memberStatisticsInfo);
    }

    /**
     * 通过指定id删除会员统计信息
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "通过指定id删除会员统计信息")
    @DeleteMapping
    public Result deleteMemberStatisticsInfo(Long id){
        return memberStatisticsInfoService.deleteMemberStatisticsInfo(id);
    }

}
